-- CALC_TV_BONUS
-- 电视机奖励

return function(user, bonus)
    -- 25%概率：无奖励（生活大爆炸、老友记、我爱露西、纸牌屋、摩登家庭），并弹出提示“哈哈哈！这节目真逗！”
    -- 15%概率：攻击+1（黑道家族），并弹出提示“你从中学到一些东西！”
    -- 15%概率：魔力+1（超能英雄），并弹出提示“你从中学到一些东西！”
    -- 10%概率：攻击+2（反恐24小时），并弹出提示“你从中学到一些东西！”
    -- 10%概率：魔力+2（邪恶力量），并弹出提示“你从中学到一些东西！”
    -- 5%概率：攻击+3（斯巴达克斯），并弹出提示“你从中学到一些东西！”
    -- 5%概率：魔力+3（权利的游戏），并弹出提示“你从中学到一些东西！”
    -- 5%概率：随机提升【机械学】能够学习的项目1级（迷失），并弹出提示“你学习了<项目名称>！”
    -- 5%概率：随机提升【电气学】能够学习的项目1级（越狱），并弹出提示“你学习了<项目名称>！”
    -- 5%概率：随机提升【航空学】能够学习的项目1级（星际迷航），并弹出提示“你学习了<项目名称>！”
    local arr = {
        { ["ratio"] = 5, ["tip"] = string.format(getLocStr("watch_movie1"), getLocStr("movie1"), getLocStr("watch_movie2"))},
        { ["ratio"] = 5, ["tip"] = string.format(getLocStr("watch_movie1"), getLocStr("movie2"), getLocStr("watch_movie2"))},
        { ["ratio"] = 5, ["tip"] = string.format(getLocStr("watch_movie1"), getLocStr("movie3"), getLocStr("watch_movie2"))},
        { ["ratio"] = 5, ["tip"] = string.format(getLocStr("watch_movie1"), getLocStr("movie4"), getLocStr("watch_movie2"))},
        { ["ratio"] = 5, ["tip"] = string.format(getLocStr("watch_movie1"), getLocStr("movie5"), getLocStr("watch_movie2"))},
        { ["bonus"] = { 2, "attack", 1 }, ["ratio"] = 15, ["tip"] = string.format(getLocStr("watch_movie1"), getLocStr("movie6"), getLocStr("watch_movie3"))},
        { ["bonus"] = { 2, "magic", 1 },  ["ratio"] = 15, ["tip"] = string.format(getLocStr("watch_movie1"), getLocStr("movie7"), getLocStr("watch_movie3"))},
        { ["bonus"] = { 2, "attack", 2 }, ["ratio"] = 10, ["tip"] = string.format(getLocStr("watch_movie1"), getLocStr("movie8"), getLocStr("watch_movie3"))},
        { ["bonus"] = { 2, "magic", 2 },  ["ratio"] = 10, ["tip"] = string.format(getLocStr("watch_movie1"), getLocStr("movie9"), getLocStr("watch_movie3"))},
        { ["bonus"] = { 2, "attack", 3 }, ["ratio"] = 5, ["tip"] = string.format(getLocStr("watch_movie1"), getLocStr("movie10"), getLocStr("watch_movie3"))},
        { ["bonus"] = { 2, "magic", 3 },  ["ratio"] = 5, ["tip"] = string.format(getLocStr("watch_movie1"), getLocStr("movie11"), getLocStr("watch_movie3"))},
        { ["tv_learn_engineering"] = {4, 1}, ["ratio"] = 5, ["tip"] = getLocStr("movie12")},
        { ["tv_learn_engineering"] = {5, 1}, ["ratio"] = 5, ["tip"] = getLocStr("movie13")},
        { ["tv_learn_engineering"] = {6, 1}, ["ratio"] = 5, ["tip"] = getLocStr("movie14")},
                    };

    local seed = DungeonM.getRandSeed("CALC_TV_BONUS");
    local info = fetchElemBySeed(arr, seed);

    -- 提升工程学手册等级
    if type(info["tv_learn_engineering"]) == "table" then
        local canLearn = EngineeringManualM.getSubjectAllCanLearn(info["tv_learn_engineering"][1], true, false);
        local seed2 = DungeonM.getRandSeed("CALC_TV_BONUS");
        local id = canLearn[1 + seed2 % #canLearn];

        info["tv_learn_engineering"] = { id, info["tv_learn_engineering"][2], };

        local tip = string.format(getLocStr("watch_movie1"), info["tip"], getLocStr("watch_movie4"));
        info["tip"] = string.format(tip, EngineeringManualM.query(id,"name"));
    end

    -- 奖励内容
    if type(info["bonus"]) ~= "table" then
        info["bonus"] = {};
    end

    return info;
end
